package mlta.buttons;

import android.R;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.Button;

public class StarButton extends Button {
	
	private static final int[] STATE_ACTIVED = {R.attr.state_active};
	
	private boolean isActived = false;
	
	public StarButton(Context context, AttributeSet attrs) {
	    super(context, attrs);
	}
	
	public boolean isActived() {
		return isActived;
	}

	public void setActived(boolean isActived) {
		this.isActived = isActived;
	}

	@Override
	protected int[] onCreateDrawableState(int extraSpace) {
	    final int[] drawableState = super.onCreateDrawableState(extraSpace + 1);
	    if (isActived)
	        mergeDrawableStates(drawableState, STATE_ACTIVED);
	    return drawableState;
	}


}
